home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / CExamples / MakeFile < prev    next >
Encoding:
Makefile  |  1998-12-03  |  11.5 KB  |  320 lines  |  [TEXT/MPS ]

  1. #    File MakeFile -  Make instructions for C examples.
  2. #
  3. #    Copyright Apple Computer, Inc. 1986-1995, 1998
  4. #    All rights reserved.
  5. #
  6. #    This makefile builds:
  7. #        The sample C tool:                Count
  8. #        The sample desk accessory:        Memory
  9. #        The sample performance tool:    TestPerf
  10. #        The sample CDev:                EditCDev
  11. #        The sample application:            Sample
  12. #        The sample application:            SillyBalls
  13. #        The sample application:            TubeTest
  14. #        The sample TE application:        TESample
  15. #
  16.  
  17. #     You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
  18. #     We also recommend requiring prototypes for all functions
  19.  
  20. SymOptions    =    -sym Full
  21. SymOpt        =    {SymOptions}
  22. COptions    =    -w 17 -proto strict {SymOpt} -D OLDROUTINELOCATIONS=0
  23. MrCOptions    =    {SymOpt} -D OLDROUTINELOCATIONS=0
  24.  
  25. # The following variable is used to define the ROM map file used by the
  26. # TestPerf component.  If necessary, you can change this to point to the
  27. # proper location of your machine's ROM map.
  28.  
  29. RomMapLoc    =    {MPW}ROM Maps:
  30. RomMap          =    Mac`gestalt mach -s`ROM.map
  31.  
  32.  
  33. # Dummy rule for building all of the samples 
  34.  
  35. all ƒ Count Memory TestPerf EditCDev Sample SillyBalls TESample TubeTest
  36.  
  37. #######################################################################
  38. # Build instructions and dependencies for the Count tool
  39. #
  40.  
  41. VERSION    = "3.4d2"
  42.  
  43. .c.x    ƒ    .c
  44.     MrC {Default}.c -o {Default}.c.x {MrCOptions}
  45.  
  46. Count ƒƒ Count.ppc Count.68k
  47.     duplicate -y Count.ppc {Targ}
  48.     duplicate -y -r Count.68k {Targ}    
  49.     Rez Count.r    GenericCFRG.r -o Count -append -d APPNAME=∂"Count∂" 
  50.     SetVersion -t 'vers' -i 1 -version "{VERSION}" Count
  51.     SetFile -m . -c 'MPS ' -t MPST Count
  52.  
  53. Count.ppc ƒ    Count.c.x Count.r    GenericCFRG.r
  54.     PPCLink -d -c 'MPS ' -t MPST {SymOpt} ∂
  55.         Count.c.x ∂
  56.         "{SharedLibraries}"StdCLib ∂
  57.         "{SharedLibraries}"InterfaceLib ∂
  58.         "{PPCLibraries}"StdCRuntime.o ∂
  59.         "{PPCLibraries}"PPCCRuntime.o ∂
  60.         "{PPCLibraries}"PPCToolLibs.o ∂
  61.         -o {Targ}
  62.  
  63. Count.68k ƒƒ Count.c.o Count.r    GenericCFRG.r
  64.     Link -d -c 'MPS ' -t MPST {SymOpt} -mf ∂
  65.         Count.c.o ∂
  66.         "{CLibraries}"StdClib.o ∂
  67.         "{Libraries}"Stubs.o ∂
  68.         "{Libraries}"IntEnv.o ∂
  69.         "{Libraries}"MacRuntime.o ∂
  70.         "{Libraries}"Interface.o ∂
  71.         "{Libraries}"ToolLibs.o ∂
  72.         -o {Targ}
  73.  
  74.  
  75. #######################################################################
  76. # Build instructions and dependencies for the Memory desk accessory
  77. #
  78.  
  79. #    The following two variables define the creator and type for the
  80. #    Memory Desk Accessory.  For System 6 compatibility, the build
  81. #    instructions should create a "Suitcase" file containing the DA.
  82. #    Suitcase files have a creator of 'DMOV' and a type of 'DFIL'.  For
  83. #    System 7 and newer, DA's can exist all by themselves, without being
  84. #    wrapped in the "womb" of the Suitcase file.  This makes it easier
  85. #    to manipulate the DA file, since the Suitcase doesn't have to be
  86. #    opened first.  DA's can be treated just like any other application.
  87. #    In this case, the creator should be 'movr' and the type should be
  88. #    'dfil' (note the difference in character case).
  89.  
  90. DACreator    =    'movr'    # change to 'DMOV' for System 6 use
  91. DAType        =    'dfil'    # change to 'DFIL' for System 6 use
  92.  
  93. Memory            ƒƒ    Memory.c.o DAEntry.a.o 
  94.     Link {SymOptions} -da -rt DRVR=12 ∂
  95.         -m DAEntry -sg Memory                # DAEntry is located in DAEntry.a.o ∂
  96.         DAEntry.a.o                            # This must preceed DRVRRuntime.o ∂
  97.         "{Libraries}"DRVRRuntime.o            # This must preceed MacRuntime.o ∂
  98.         Memory.c.o ∂
  99.         "{Libraries}"MacRuntime.o ∂
  100.         "{Libraries}"Interface.o ∂
  101.         -o Memory -c {DACreator} -t {DAType}
  102.  
  103. Memory            ƒƒ    Memory.r
  104.     Rez -rd -c {DACreator} -t {DAType} Memory.r -a -o Memory
  105.  
  106. Memory.NOASM        ƒ    Memory.DRVW Memory.r
  107.     Rez -rd -c {DACreator} -t {DAType} -d NOASM_BUILD Memory.r -o Memory.NOASM
  108.     Duplicate -y Memory.NOASM Memory
  109.  
  110. Memory.DRVW     ƒ    Memory.c.o
  111.     Link -w -rt DRVW=0 ∂
  112.         -sg Memory ∂
  113.         "{Libraries}"DRVRRuntime.o ∂
  114.         Memory.c.o ∂
  115.         "{Libraries}"IntEnv.o ∂
  116.         "{Libraries}"MacRuntime.o ∂
  117.         "{Libraries}"Interface.o ∂
  118.         -o Memory.DRVW -c "????" -t "????"
  119.  
  120.  
  121. #######################################################################
  122. # Build instructions and dependencies for the TestPerf tool
  123. #
  124. # Warning:  this sample won't build for machines which do not
  125. # have ROM maps (Power Macintoshes being notable examples).
  126.  
  127. TestPerf    ƒ    TestPerf.c.o
  128.     Link -d # suppress duplicate warnings ∂
  129.         -o TestPerf -t MPST -c 'MPS ' ∂
  130.         -l -la > TestPerf.map # produce link map file ∂
  131.         TestPerf.c.o "{Libraries}"PerformLib.o ∂
  132.         "{Libraries}"Interface.o ∂
  133.         "{Libraries}"IntEnv.o ∂
  134.         "{Libraries}"MacRuntime.o ∂
  135.         "{CLibraries}"StdCLib.o
  136.     Set ThisDir `Directory`
  137.     Directory "{RomMapLoc}"
  138.     Make "{RomMap}" >"{TempFolder}Make.Out" && ("{TempFolder}"Make.Out && Delete "{TempFolder}Make.out") || set status 0
  139.     Directory "{ThisDir}"
  140.     Unset ThisDir
  141.     Catenate "{RomMapLoc}{ROMMap}" >> TestPerf.map ≥dev:null || set status 0
  142.  
  143.  
  144. #######################################################################
  145. # Build instructions and dependencies for the EditCDev cdev
  146. #
  147. #    EditCdev is a sample Control Panel device (cdev) that 
  148. #    demonstrates the usage of the edit-related messages.  
  149. #    EditCdev demonstrates how to implement an editText item
  150. #    in a Control Panel Device.  It utilizes the new undo, cut, copy,
  151. #    paste, and delete messages that are sent to cdevs in
  152. #    response to user menu selections.
  153. #
  154. #    It is comprised of two editText items that can be edited 
  155. #    and moved between via the mouse or tab key.
  156. #
  157.  
  158. cdevObjs    = EditCDev.c.o
  159.                     
  160. cdevLibs    = "{Libraries}"Interface.o
  161.  
  162. Destination = {SystemFolder}Control Panels:
  163.                     
  164. EditCDev        ƒƒ    {cdevObjs}
  165.     Link -o {Targ} -rt cdev=-4064 -m TEXTCDEV {cdevObjs} {cdevLibs}
  166.  
  167. EditCDev        ƒƒ    EditCDev.r
  168.     Rez -o {Targ} EditCDev.r -t cdev -c hack -rd -append
  169.  
  170. EditCDev        ƒƒ    {cdevObjs} EditCDev.r
  171.     Setfile EditCDev -a B
  172.     Duplicate -y EditCDev "{Destination}"
  173.  
  174.             
  175. #######################################################################
  176. # Build instructions and dependencies for the Sample application
  177. #            
  178. #    Sample is an example application that demonstrates how to
  179. #    initialize the commonly used toolbox managers, operate 
  180. #    successfully under MultiFinder, handle desk accessories, 
  181. #    and create, grow, and zoom windows.
  182. #
  183. #    It does not by any means demonstrate all the techniques 
  184. #    you need for a large application. In particular, Sample 
  185. #    does not cover exception handling, multiple windows/documents, 
  186. #    sophisticated memory management, printing, or undo. All of 
  187. #    these are vital parts of a normal full-sized application.
  188. #
  189. #    This application is an example of the form of a Macintosh 
  190. #    application; it is NOT a template. It is NOT intended to be 
  191. #    used as a foundation for the next world-class, best-selling, 
  192. #    600K application. A stick figure drawing of the human body may 
  193. #    be a good example of the form for a painting, but that does not 
  194. #    mean it should be used as the basis for the next Mona Lisa.
  195. #
  196. #    We recommend that you review this program or TESample before 
  197. #    beginning a new application.
  198. #
  199. #     You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
  200. #     We also recommend requiring prototypes for all functions
  201.                             
  202. sampObjs    = Sample.c.o
  203.  
  204. sampLibs    = "{Libraries}"MacRuntime.o ∂
  205.               "{Libraries}"Interface.o
  206.         
  207. Sample        ƒƒ {sampObjs} Sample.r
  208.     Link -o {Targ} {sampObjs} {sampLibs} {SymOptions}
  209.     Rez -rd -o {Targ} Sample.r -append
  210.     SetFile {Targ} -t APPL -c 'MOOS' -a B
  211.  
  212.  
  213.  
  214. #######################################################################
  215. # Build instructions and dependencies for the SillyBalls application
  216. #    
  217. #    This is a very simple sample program that demonstrates how to use Color 
  218. #    QuickDraw.  It is about two pages of code, and does nothing more than open
  219. #    a color window and draw randomly colored ovals in the window.
  220. #    
  221. #    The purpose is to show how to get some initial results with Color QuickDraw.
  222. #    It is a complete program and is very short to be as clear as possible.
  223. #    
  224. #    It does not have an Event Loop.  It is not fully functional in the sense that
  225. #    it does not do all the things you would expect a well behaved Macintosh 
  226. #    program to do, like size the window naturally, have an event loop, use menus, 
  227. #    etc.
  228. #
  229. #    See Sample and TESample for the general structure and MultiFinder techniques that
  230. #    we recommend that you use when building a new application.
  231. #
  232. # MPW 3.0 and later: We override the default COptions to turn on strict prototyping;
  233. #    add '-proto strict' to your UserStartup when you tire of the warning from Make.
  234.  
  235. sillyObs        =    SillyBalls.c.o
  236.  
  237. sillyLibs        = "{Libraries}"Interface.o ∂
  238.                   "{Libraries}"MacRuntime.o 
  239.  
  240. SillyBalls    ƒƒ    {sillyObs}
  241.     Link -o {Targ} {sillyObs} {sillyLibs} {SymOptions}
  242.     SetFile {Targ} -t APPL -c '????'
  243.  
  244.  
  245.  
  246. #######################################################################
  247. # Build instructions and dependencies for the TESample application
  248. #    
  249. #    TESample is an example application that demonstrates how 
  250. #    to initialize the commonly used toolbox managers, operate 
  251. #    successfully under MultiFinder, handle desk accessories and 
  252. #    create, grow, and zoom windows. The fundamental TextEdit 
  253. #    toolbox calls and TextEdit autoscroll are demonstrated. It 
  254. #    also shows how to create and maintain scrollbar controls.
  255. #
  256. #    It does not by any means demonstrate all the techniques you 
  257. #    need for a large application. In particular, Sample does not 
  258. #    cover exception handling, multiple windows/documents, 
  259. #    sophisticated memory management, printing, or undo. All of 
  260. #    these are vital parts of a normal full-sized application.
  261. #
  262. #    This application is an example of the form of a Macintosh 
  263. #    application; it is NOT a template. It is NOT intended to be 
  264. #    used as a foundation for the next world-class, best-selling, 
  265. #    600K application. A stick figure drawing of the human body may 
  266. #    be a good example of the form for a painting, but that does not 
  267. #    mean it should be used as the basis for the next Mona Lisa.
  268. #
  269. #    We recommend that you review this program or Sample before 
  270. #    beginning a new application. Sample is a simple app. which doesn’t 
  271. #    use TextEdit or the Control Manager.
  272. #
  273. #     You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
  274. #     We also recommend requiring prototypes for all functions
  275.  
  276. teObjs    = TESample.c.o ∂
  277.           TESampleGlue.a.o
  278.             
  279. teLibs    = "{Libraries}"MacRuntime.o ∂
  280.           "{Libraries}"Interface.o
  281.  
  282. TESample        ƒƒ {teObjs} TESample.r
  283.     Link -o {Targ} {teObjs} {teLibs} {SymOptions}
  284.     Rez -rd -append -o {Targ} TESample.r
  285.     SetFile {Targ} -t APPL -c 'MOOT' -a B
  286.  
  287.  
  288.  
  289. #######################################################################
  290. # Build instructions and dependencies for the TubeTest application
  291. #    
  292. #    The TubeTest program is a simple demonstration of how to use the Palette 
  293. #    Manager in a color program.  It has a special color palette that is associated
  294. #    with the main window.  The colors are animated using the Palette Manager 
  295. #    to give a flowing tube effect.  The program is very simple, and the Palette
  296. #    Manager and drawing parts are put in separate subroutines to make it easier
  297. #    to figure out what is happening.
  298. #    
  299. #    The program is still a complete Macintosh application with a Main Event Loop,
  300. #    so there is the extra code to run the MEL.  
  301. #    
  302. #    There is a resource file that is necessary as well, to define the Menus, Window,
  303. #    Dialog, and Palette resources used in the program.  
  304. #
  305. #    See Sample and TESample for the general structure and MultiFinder techniques that
  306. #    we recommend that you use when building a new application.
  307. #
  308. # MPW 3.0 and later: We override the default COptions to turn on strict prototyping;
  309. #    add '-r' to your UserStartup when you tire of the warning from Make.
  310.  
  311. tubeObjs    = TubeTest.c.o
  312.                     
  313. tubeLibs     = "{Libraries}"Interface.o ∂
  314.               "{Libraries}"MacRuntime.o 
  315.  
  316. TubeTest    ƒƒ    {tubeObjs} TubeTest.r
  317.     Link -o {Targ} {tubeObjs} {tubeLibs}
  318.     Rez -rd -o {Targ} TubeTest.r -append
  319.     SetFile {Targ} -t APPL -c '????'
  320.